
export const order_table_ctl = [
  {
    label: 'ID',
    prop: 'id',
    sortable: false,
    visiable: true,
  },
  {
    label: '订单号',
    prop: 'order_no',
    sortable: false,
    visiable: true,
  },
  {
    label: '订报人',
    prop: 'receiver',
    sortable: false,
    visiable: true,
  },
  {
    label: '手机号',
    prop: 'phone',
    sortable: false,
    visiable: true,
  },
  {
    label: '订报数量',
    prop: 'amount',
    sortable: false,
    visiable: true,
  },
  {
    label: '地区',
    prop: 'region',
    sortable: false,
    visiable: true,
  },
  {
    label: '地址',
    prop: 'province_city',
    sortable: false,
    visiable: true,
  },
  {
    label: '详细地址',
    prop: 'address',
    sortable: false,
    visiable: true,
  },
  {
    label: '订报类型',
    prop: 'subscription_type',
    sortable: false,
    visiable: true,
  },
  {
    label: '学校',
    prop: 'school',
    sortable: false,
    visiable: true,
  },
  {
    label: '班级',
    prop: 'classes',
    sortable: false,
    visiable: true,
  },
  {
    label: '学生姓名',
    prop: 'student_name',
    sortable: false,
    visiable: true,
  },
  {
    label: '开始日期',
    prop: 'start_date',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
  {
    label: '结束日期',
    prop: 'end_date',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
  {
    label: '总金额',
    prop: 'total_fee',
    sortable: false,
    visiable: true,
  },
  {
    label: '实际支付金额',
    prop: 'actual_paid',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
  {
    label: '支付状态',
    prop: 'pay_status',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },

  {
    label: '更新时间',
    prop: 'update_time',
    sortable: false,
    visiable: true,
    // formatter: tableFormat,
  },
  {
    label: '创建时间',
    prop: 'create_time',
    sortable: false,
    visiable: true,
    // formatter: tableFormat,
  },
]

export const options= [
  // {
  //   value: '', // 空字符串表示显示所有数据
  //   label: '全部'
  // },
  {
    value: '普通订报',
    label: '普通订报'
  },
  {
    value: '小记者订报',
    label: '小记者订报'
  }
]

export const pay_list= [
  // {
  //   value: '', // 空字符串表示显示所有数据
  //   label: '全部'
  // },
  {
    value: 0,
    label: '未支付'
  },
  {
    value: 1,
    label: '已支付'
  },
  {
    value: 2,
    label: '支付取消'
  },
  {
    value: 3,
    label: '支付失败'
  },
  {
    value: 4,
    label: '正在退款'
  },
  {
    value: 5,
    label: '退款失败'
  },
  {
    value: 6,
    label: '退款成功'
  },
]

export const express_list= [
  // {
  //   value: '', // 空字符串表示显示所有数据
  //   label: '全部'
  // },
  {
    value: 0,
    label: '未发货'
  },
  {
    value: 1,
    label: '已发货'
  }
]

export const app_user_table_ctl = [
  {
    label: 'ID',
    prop: 'id',
    sortable: false,
    visiable: true,
  },
  {
    label: '名称',
    prop: 'name',
    sortable: false,
    visiable: true,
  },
  {
    label: '用户名',
    prop: 'username',
    sortable: false,
    visiable: true,
  },
  {
    label: '更新时间',
    prop: 'updateTime',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
  {
    label: '创建时间',
    prop: 'createTime',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
]

let status_label = ['未支付','已支付','支付取消','支付失败','正在退款','退款失败','退款成功']

function tableFormat(row, column, index) {
  // console.log(row, column, index)
  let str = ''
  switch (column.property) {
    case 'update_time':
      str = row.update_time ? row.update_time.slice(0, 10) : ''
      break
    case 'create_time':
      str = row.create_time.slice(0, 10)
      break
    case 'actual_paid':
      str = row.actual_paid / 100
      break
    case 'start_date':
      str = row.start_date.slice(0, 7)
      break
    case 'end_date':
      str = row.end_date.slice(0, 7)
      break
    case 'pay_status':
      str = status_label[row.pay_status]
      break

  }
  return str
}

// 以下数据作展示用
export const default_table_ctl = [
  {
    label: 'ID',
    prop: 'id',
    sortable: false,
    visiable: true,
  },
  {
    label: '名称',
    prop: 'name',
    sortable: false,
    visiable: true,
  },
  {
    label: '用户名',
    prop: 'username',
    sortable: false,
    visiable: true,
  },
  {
    label: '更新时间',
    prop: 'updateTime',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
  {
    label: '创建时间',
    prop: 'createTime',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
]
// 以下数据作展示用
export const dict_table_ctl = [
  {
    label: 'ID',
    prop: 'id',
    sortable: false,
    visiable: true,
  },
  {
    label: '参数名称',
    prop: 'name',
    sortable: false,
    visiable: true,
  },
  {
    label: '参数数值',
    prop: 'content',
    sortable: false,
    visiable: true,
  },
  // {
  //   label: '更新时间',
  //   prop: 'updateTime',
  //   sortable: false,
  //   visiable: true,
  //   formatter: tableFormat,
  // },
  // {
  //   label: '创建时间',
  //   prop: 'createTime',
  //   sortable: false,
  //   visiable: true,
  //   formatter: tableFormat,
  // },
]
